package com.ts.common.exception;

public class BaseException extends RuntimeException {

    private static final long serialVersionUID = 3638887403429291292L;
    /**
     * 提示
     */
    public static final int WARNING_CODE = 1000;
    /**
     * 错误
     */
    public static final int ERROR_CODE = 1001;
    /**
     * 状态码
     */
    private final int code;

    public BaseException(String msg) {
        super(msg);
        this.code = BaseException.WARNING_CODE;
    }

    public BaseException(int code, String msg) {
        super(msg);
        this.code = code;
    }

    public int getCode() {
        return code;
    }

}
